<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../libs/layui/css/layui.css">
</head>

<body>
  <!-- 1 拷贝标签 -->
  <input type="text" class="layui-input" id="test1">

  <button>获取日期</button>


  <script src="../libs/layui/layui.js"></script>

  <script>
    // 2 js代码 
    var laydate = layui.laydate;
    //执行一个laydate实例
    laydate.render({
      elem: '#test1' //指定元素
    });

    document.querySelector("button").onclick = function () {
      console.log(document.querySelector("#test1").value);
    }
  </script>
</body>

</html>